package com.testlio.assignment.model;

import lombok.Data;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * Entity class representing an issue in the system.
 * Maps to the 'issues' table in the database.
 * Database fields:
 * - id: Auto-incremented primary key
 * - title: Issue title
 * - description: Detailed description of the issue
 * - created_at: Timestamp when the issue was created
 * - updated_at: Timestamp when the issue was last updated
 */
@Entity
@Table(name = "issues")
@Data
public class Issue {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(nullable = false)
    private String title;

    @Column(nullable = false)
    private String description;

    @Column(name = "created_by", nullable = false)
    private String createdBy;

    @Column(name = "created_at", nullable = false)
    private LocalDateTime createdAt;

    @Column(name = "updated_by")
    private String updatedBy;

    @Column(name = "updated_at", nullable = false)
    private LocalDateTime updatedAt;
}
